package com.itheima;

import com.example.MyImportSelector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
//启动类也是一个配置类
//@Import({TokenParser.class, HeaderConfig.class}) //导入bean及导入配置类
@Import(MyImportSelector.class)//导入ImportSelector接口实现类，这个实现类中定义了哪些bean是需要引入到容器中
@SpringBootApplication
public class SpringbootThirdbeanApplication {

    public static void main(String[] args) {
      SpringApplication.run(SpringbootThirdbeanApplication.class, args);

        //当启动类启动后，可以得到Spring容器 IOC容器
      /*  ConfigurableApplicationContext context =
                SpringApplication.run(SpringbootThirdbeanApplication.class, args);
        //通过Spring容器获取容器中存储的bean对象
        Object bean = context.getBean("deptController");
        System.out.println("bean = " + bean);
        */
    }

}
